package demo2;

import demo1.Student;
public class TestString {
    public static void main(String[] args) {
        String name = "zhangshan";
        String name2 = new String("lisi");
        char[] array = {'l','i','s','i'};
        String name1 = new String(array);
        System.out.println(name1);
        byte[] arr = new byte[]{97,98,99,100,101};
        String name3 = new String(arr);
        System.out.println(name3);
        String name4 = "abc";
        String name5 = "abc";
        System.out.println(name4 == name5);
        String str1 = "abcdefabcdabcfa";
        String str2 = "AbcD";
        System.out.println(str1.compareToIgnoreCase(str2));
        System.out.println(str1.lastIndexOf("fa"));
        System.out.println(str1.lastIndexOf('b'));
        String s4 = String.valueOf(new Student("Hanmeimei", 18));
        System.out.println(s4);
    }
}
